package cate.game.role.pvp.pointrace.msg;

import cate.game.GameBody;
import cate.game.client.ClientContext;
import cate.game.client.msg.ClientMsg;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgInput;
import easy.java.practice.errorcode.EcResult;

import static cate.game.client.msg.MsgSender.send;
import static cate.game.client.msg.id.MsgIdBPointRace.GET_PS_REQ;

@ClientMsg(title = "对手阵容 请求")
public class PointRaceGetPsReq implements MsgInput {

    public String uid;

    @Override
    public MsgConfig conf() {
        return GET_PS_REQ;
    }

    @Override
    public void execute(GameBody game, ClientContext cc) {
        EcResult<PointRaceGetPsResp> r = game.pvp.pointRace.getHandler().handleGetPsReq(cc.getRole(), this);
        if (r.ok()) {
            send(cc::sendNow, r.data);
        }
    }
}
